
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class Stub {
	//private Format TraitFormat(Ligne);
	private String ligne;


	public static Format TraitFormat(Format res, String strLineIn){
		
		
		    	if (strLineIn.equals("300 4A A7")){
		    		res=new Format(3);
		    		ArrayList<Integer> tab=new ArrayList<Integer>();
		    		tab.add(74);
		    		tab.add(167);
		    		res.setTabOctetB10(tab)  ;
		    	
		    		return res;
		   
		    	}
		    
		    if (strLineIn.equals("301 12B4")){
		    	res=new Format(2);
		    	
	    		ArrayList<Integer> tab=new ArrayList<Integer>();
	    		tab.add(18);
	    		tab.add(180);
	    		res.setTabOctetB10(tab)  ;
	    	
	    		return res;
	    		
	    		}
		    if (strLineIn.equals("302 C3")){
		    	res=new Format(1);
		    	
	    		ArrayList<Integer> tab=new ArrayList<Integer>();
	    		tab.add(195);
	    		res.setTabOctetB10(tab)  ;
	    	
	    		return res;
	    		
	    		}
		    if (strLineIn.equals("303 C345de")){
		    	res=new Format(0);
		    	
	    		ArrayList<Integer> tab=new ArrayList<Integer>();
	    		//tab.add(C345);
	    		res.setTabOctetB10(tab)  ;
	    	
	    		return res;
	    		
	    		}
		    if (strLineIn.equals("304 A7D1")){
		    	res=new Format(2);
		    	
	    		ArrayList<Integer> tab=new ArrayList<Integer>();
	    		tab.add(167);
	    		tab.add(209);
	    		res.setTabOctetB10(tab)  ;
	    	
	    		return res;
	    		
	    		}
		    res=new Format(4);
			return res;
			
		    }


	public Stub(String inputFile,String outputFile) {
		// TODO Auto-generated method stub

		
		
		String diff ="";
		try{
		 
			BufferedReader brinput = new BufferedReader(new FileReader(inputFile));
		    BufferedWriter brOutput = new BufferedWriter(new FileWriter(outputFile));
		    String strLineIn;
		   
		    //Read File Line By Line
		    int lineCount = 0;

		    while ((strLineIn = brinput.readLine()) != null){
		    	 String strLineOut="";
		    	
		    	
		    	Format res = null ;
		    	res=/*Stub.*/TraitFormat(res, strLineIn);
		    	
		    	
		    	strLineOut+=res.toString();
		    	if (strLineOut!=null ){
		    	brOutput.write(strLineOut);
		    	brOutput.newLine();
		    	}
		    }
		    brOutput.close();
			    }catch (Exception e){//Catch exception if any
			      System.err.println("Error: " + e.getMessage());
			      diff += "Error: " + e.getMessage()+"\n";
			    }

}
	}









